package com.itheima.d6_object_stream;

import java.io.*;
import java.sql.Array;
import java.util.ArrayList;

/*
  目标：掌握对象字节输出流的使用：序列化对象。
 */
public class Test1ObjectOutputStream {
    public static void main(String[] args) throws Exception {
        FileOutputStream fis = new FileOutputStream("object.txt");
        ObjectOutputStream ois = new ObjectOutputStream(fis);

        Student s1 = new Student("李白", "太白");
        Student s2 = new Student("鲁班", "七号");
        ArrayList<Student> list = new ArrayList<>();
        list.add(s1);
        list.add(s2);
        ois.writeObject(list);

        ois.close();
    }

}
